/**
 * 
 */
package persistencia.dao.impl;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author Roberto
 *
 * 12/08/2013
 */

public class Conexao {  
   public static final int POSTGRESQL = 0;  
   private static final String PostgreSQLDriver = "org.postgresql.Driver";
   // outros bancos
   public static Connection con;
   
   public static Connection getConexao(String url, String nome, String senha,  
         int banco) throws ClassNotFoundException, SQLException {  
      switch (banco) {        
      case POSTGRESQL:           
         Class.forName(PostgreSQLDriver);  
         break;
      }  
      con = DriverManager.getConnection(url, nome, senha);
      return con;
   }  
}